<template>
  <div v-show="visible" class="zx-wrap rounded-lg fixed bottom-4 right-4">
    <div
      class="bg-red rounded-t-lg h-15 flex text-white pt-[9px] px-3 pb-[11px]"
      slot="title"
    >
      <img src="@/assets/img/logo.png" class="w-10 h-10 rounded-full" alt="" />
      <span class="grow ml-1 mt-px text-sm">售前咨询小芸</span>
      <i
        class="el-icon-close hover:cursor-pointer mt-1 mr-1 font-bold"
        @click="close"
      ></i>
    </div>

    <div class="h-[378px]"></div>

    <div class="h-[100px] border-t p-2">
      <textarea placeholder="请输入" class="w-full" cols="3"></textarea>
      <div class="flex justify-end">
        <button class="text-white py-2 px-4 bg-red text-xs rounded">
          发送
        </button>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      visible: false,
    };
  },
  methods: {
    open() {
      this.visible = true;
      this.$store.commit("SQ");
    },
    close() {
      this.visible = false;
      this.$store.commit("SQ", false);
      this.$store.commit("ZX", false);
    },
  },
};
</script>

<style scoped>
.zx-wrap {
  width: 330px;
  height: 538px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: -10px 20px 60px 0px rgba(110, 133, 168, 0.08);
  z-index: 3333;
}
/deep/ .el-dialog__header {
  padding: 0;
}
/deep/ .el-dialog__headerbtn {
  top: 11px;
  right: 31px;
  font-size: 17px;
}
/deep/ .el-dialog__headerbtn .el-dialog__close {
  color: white;
}
/deep/ .el-dialog__headerbtn:hover .el-dialog__close {
  color: white;
}
</style>